<% if (process.env.NODE_ENV==="production") { %>
    <script src="//page.cashtoutiao.com/cdnjs/vconsole.min.js"></script>
    <script type="text/javascript">
        window.vConsole = new window.VConsole();
    </script>
    <% } %>
        <% if (process.env.NODE_ENV==="release") { %>
            <script>
                var _hmt = _hmt || [];
                (function() {
                    var hm = document.createElement("script");
                    hm.src = "https://hm.baidu.com/hm.js?6d82bd22ab6a39317fd091ce9d1ad99f";
                    var s = document.getElementsByTagName("script")[0];
                    s.parentNode.insertBefore(hm, s);
                })();

                (function(para) {
                    var p = para.sdk_url,
                        n = para.name,
                        w = window,
                        d = document,
                        s = 'script',
                        x = null,
                        y = null;
                    if (typeof(w['sensorsDataAnalytic201505']) !== 'undefined') {
                        return false;
                    }
                    w['sensorsDataAnalytic201505'] = n;
                    w[n] = w[n] || function(a) {
                        return function() {
                            (w[n]._q = w[n]._q || []).push([a, arguments]);
                        }
                    };
                    var ifs = ['track', 'quick', 'register', 'registerPage', 'registerOnce', 'trackSignup', 'trackAbtest', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister', 'getAppStatus'];
                    for (var i = 0; i < ifs.length; i++) {
                        w[n][ifs[i]] = w[n].call(null, ifs[i]);
                    }
                    if (!w[n]._t) {
                        x = d.createElement(s), y = d.getElementsByTagName(s)[0];
                        x.async = 1;
                        x.src = p;
                        x.setAttribute('charset', 'UTF-8');
                        y.parentNode.insertBefore(x, y);
                        w[n].para = para;
                    }
                })({
                    sdk_url: '//page.cashtoutiao.com/cdnjs/sa-sdk-javascript-1.12.9/sensorsdata.min.js',
                    heatmap_url: '//page.cashtoutiao.com/cdnjs/sa-sdk-javascript-1.12.9/heatmap.min.js',
                    name: 'sensors',
                    use_app_track: true,
                    server_url: 'https://scd.collect.cashtoutiao.com:8106/sa?project=huiyouyuan',
                    heatmap: {},
                });
                sensors.quick('autoTrack');
            </script>
            <% } %>

                <script type="text/javascript">
                    (function() {
                        function refreshRem() {
                            var root = document.documentElement
                            var w = root.getBoundingClientRect().width
                                /*if (w > 750) {
                                  w = 750
                                }*/
                            var fontSize = w / 7.5 + 'px'; /* 设计稿是750 */
                            root.style.fontSize = fontSize;
                        }
                        refreshRem()
                        if (document.documentElement.clientWidth === 0)
                            setTimeout(refreshRem, 100)
                        var t;
                        window.addEventListener('resize', function() {
                            clearTimeout(t);
                            t = setTimeout(refreshRem, 300);
                        })
                        window.addEventListener('pageshow', function(e) {
                            if (e.persisted) {
                                clearTimeout(t);
                                t = setTimeout(refreshRem, 300);
                            }
                        }, false);
                    })()
                </script>